"""
vlog app back-up service
"""

from flask import Flask
import logging  
import utils.common.log as log 
import utils.common.func as func
import utils.pgsql.base.pgconn as pgconn
import utils.config.websvrini as ini
from payapi.tech import tech_module
from payapi.paymanage import paymanage_module
import utils.common.initres as initres

SVR_HTTP_PORT = 33400
SVR_NAME = "payService"
SVR_VERSION = "0.0.1"

app = Flask(__name__)

app.register_blueprint(tech_module)
app.register_blueprint(paymanage_module)




@app.route("/", methods=["HEAD"])
def head():
    return "200"


if __name__ == "__main__":
 
    # flasklog = logging.getLogger('werkzeug')
    # flasklog.setLevel(logging.WARNING)
    iniPath = ""
    iniPath=initres.iniPath()
    pgDic = ini.get_postgres(iniPath)
    if pgconn.pgInit(pgDic):
        app.run(host="0.0.0.0", port=SVR_HTTP_PORT, debug=False)  
    else:
        log.logging.error("pg init failed !!!!!!!!!!!!!!!!!!")
